var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var Person = /** @class */ (function () {
    // 函数参数的类型
    function Person(name, age) {
        this.name = name;
        this.age = age;
    }
    Person.prototype.setName = function (name) {
        this.name = name;
    };
    return Person;
}());
var p = new Person('jack', 19);
// p.name;
// p.age;
// p.setName('bob')
var Son = /** @class */ (function (_super) {
    __extends(Son, _super);
    function Son(name, age, sex) {
        var _this = _super.call(this, name, age) // 调用父类的constructor方法
         || this;
        _this.address = '深圳';
        // 函数定义在实例对象上
        _this.sayAge = function (age) {
            console.log(age);
        };
        _this.sex = sex;
        return _this;
    }
    // 静态方法
    Son.say = function (str) {
        console.log(str);
    };
    // 函数定义在原型对象上
    Son.prototype.setName = function (name) {
        this.name = 'haha_' + name;
    };
    // ES7
    // 静态属性给Son类使用的
    Son.a = 123;
    return Son;
}(Person));
var s = new Son('tom', 20, '男');
console.log(s);
Son.a;
Son.say('hello');
